//package com.atguigu.bean.servlet;
//
//import com.atguigu.bean.bean.User;
//import com.atguigu.bean.service.UserService;
//
//import com.atguigu.bean.service.impl.UserServiceImpl;
//
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//public class RegistServletServlet extends HttpServlet {
//    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        doGet(request,response);
//    }
//
//    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        request.setCharacterEncoding("UTF-8");
//
//        String username = request.getParameter("username");
//        String password = request.getParameter("password");
//        String email = request.getParameter("email");
//
//        UserService userService = new UserServiceImpl();
//        User user = new User(null, username, password, email);
//        boolean falg = userService.zhucejieguo(user);
//        if (falg) {
//            response.sendRedirect(request.getContextPath() + "/pages/user/regist_success.html");
//        } else {
//            request.getRequestDispatcher("/pages/user/regist.html").forward(request, response);
//
//        }
//
//
//
//
//
//    }
//}
